package com.xmut.mall.coupon.controller;

import com.xmut.mall.coupon.service.PromotionGoodsService;
import com.xmut.mall.coupon.utils.RespBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("coupon/promotiongoods")
public class PromotionGoodsController {
    @Autowired
    private PromotionGoodsService promotionGoodsService;

    /**
     * 根据skuid获取该sku对应的优惠券
     * @param skuId
     * @return
     */
    @GetMapping("/getProductDetailCoupon/{skuId}")
    public RespBean getProductDetailCoupon(@PathVariable Long skuId){
        return promotionGoodsService.getProductDetailCoupon(skuId);
    }

}
